load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@kubevirt//tools/ginkgo:ginkgo.bzl", "ginkgo_test")

go_library(
    name = "go_default_library",
    srcs = ["imageupload.go"],
    importpath = "kubevirt.io/kubevirt/pkg/virtctl/imageupload",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/apimachinery/patch:go_default_library",
        "//pkg/apimachinery/wait:go_default_library",
        "//pkg/storage/types:go_default_library",
        "//pkg/util:go_default_library",
        "//pkg/virtctl/clientconfig:go_default_library",
        "//pkg/virtctl/templates:go_default_library",
        "//staging/src/kubevirt.io/api/instancetype:go_default_library",
        "//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
        "//vendor/github.com/cheggaaa/pb/v3:go_default_library",
        "//vendor/github.com/spf13/cobra:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
        "//vendor/k8s.io/client-go/kubernetes:go_default_library",
        "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1:go_default_library",
        "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/upload/v1beta1:go_default_library",
    ],
)

go_test(
    name = "go_default_test",
    srcs = [
        "imageupload_suite_test.go",
        "imageupload_test.go",
    ],
    race = "on",
    tags = ["cov"],
    deps = [
        ":go_default_library",
        "//pkg/virtctl/testing:go_default_library",
        "//staging/src/kubevirt.io/api/instancetype:go_default_library",
        "//staging/src/kubevirt.io/client-go/containerizeddataimporter/fake:go_default_library",
        "//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
        "//staging/src/kubevirt.io/client-go/testutils:go_default_library",
        "//tests/libstorage:go_default_library",
        "//vendor/github.com/onsi/ginkgo/v2:go_default_library",
        "//vendor/github.com/onsi/gomega:go_default_library",
        "//vendor/github.com/spf13/cobra:go_default_library",
        "//vendor/go.uber.org/mock/gomock:go_default_library",
        "//vendor/golang.org/x/sync/errgroup:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
        "//vendor/k8s.io/client-go/kubernetes:go_default_library",
        "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library",
        "//vendor/k8s.io/client-go/testing:go_default_library",
        "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1:go_default_library",
    ],
)

ginkgo_test(
    name = "go_parallel_test",
    ginkgo_args = ["-p"],
    go_test = ":go_default_test",
    tags = ["nocov"],
)
